//
//  Home_cellTableViewCell.m
//  恒记
//
//  Created by Ctair on 16/5/6.
//  Copyright © 2016年 can. All rights reserved.
//

#import "Home_cellTableViewCell.h"

@implementation Home_cellTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        [self.contentView addSubview:self.markImageView];
        [self.contentView addSubview:self.tipsLabel];
        [self.contentView addSubview:self.describLabel];
        [self.contentView addSubview:self.balanceLabel];
        [self.contentView addSubview:self.employLabel];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
#pragma mark *** Getter ***
- (UILabel *)employLabel{
    if (_employLabel == nil) {
        _employLabel = [[UILabel alloc] initWithFrame:CRM(CGRectGetMinX(self.balanceLabel.frame), CGRectGetMaxY(self.balanceLabel.frame), SCREEN_WIDTH - CGRectGetMinX(self.balanceLabel.frame) - 35 * PROPORTION_W, CGRectGetHeight(self.describLabel.frame))];
        _employLabel.textAlignment = NSTextAlignmentRight;
        _employLabel.text = @"00:00";
        [_employLabel setTextColor:[UIColor greenColor]];
    }
    return _employLabel;
}
- (UILabel *)balanceLabel{
    if (_balanceLabel == nil) {
        _balanceLabel = [[UILabel alloc] initWithFrame:CRM(CGRectGetMaxX(self.tipsLabel.frame) + 5, 5, SCREEN_WIDTH - CGRectGetMaxX(self.tipsLabel.frame) - 5 - 35 * PROPORTION_W, CGRectGetHeight(self.tipsLabel.frame))];
        _balanceLabel.textAlignment = NSTextAlignmentRight;
        _balanceLabel.text = @"00.00";
        [_balanceLabel setTextColor:[UIColor redColor]];
    }
    return _balanceLabel;
}
- (UILabel *)describLabel{
    if (_describLabel == nil) {
        _describLabel = [[UILabel alloc] initWithFrame:CRM(CGRectGetMaxX(self.markImageView.frame) + 5, CGRectGetMaxY(self.tipsLabel.frame), SCREEN_WIDTH - CGRectGetMaxX(self.markImageView.frame) - 150 *PROPORTION_W, CGRectGetHeight(self.markImageView.frame) / 2)];
        [_describLabel setTextColor:[UIColor lightGrayColor]];
    }
    return _describLabel;
}
- (UILabel *)tipsLabel{
    if (_tipsLabel == nil) {
        _tipsLabel = [[UILabel alloc] initWithFrame:CRM(CGRectGetMaxX(self.markImageView.frame) + 5, 5, SCREEN_WIDTH - CGRectGetMaxX(self.markImageView.frame) - 150 * PROPORTION_W, CGRectGetHeight(self.markImageView.frame) / 2)];
    }
    return _tipsLabel;
}
- (UIImageView *)markImageView{
    if (_markImageView == nil) {
        _markImageView = [[UIImageView alloc] initWithFrame:CRM(5 * PROPORTION_W, 5 * PROPORTION_H, 68 * PROPORTION_W, 68 * PROPORTION_H)];
        _markImageView.layer.cornerRadius = 34 * PROPORTION_H;
        _markImageView.layer.masksToBounds = YES;
        _markImageView.contentMode = UIViewContentModeCenter;
    }
    return _markImageView;
}
@end
